package com.cloud.workTest;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.cloud.bean.SerialBean;

import static com.alibaba.fastjson.JSON.parseObject;

/**
 * 证明无法自动识别下划线
 */
public class ParesObjectTest {
    public static void main(String[] args) {
        String jsonStr = "{\"id\":\"45\",\"name\":\"shuchuanbiao\",\"pass_word\":\"123456\"}";
        SerialBean serialBean = parseObject(jsonStr, new TypeReference<SerialBean>() {});
        System.out.println(serialBean);

        SerialBean serialBean1 = JSON.parseObject(jsonStr, SerialBean.class);
        System.out.println(serialBean1);
    }


}
